package com.bw.Controller;

import com.bw.bean.Vo;
import com.bw.service.OrderInfoService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class OrderinfoController {
    @Autowired
    OrderInfoService orderInfoService;

    @RequestMapping("/findlist")
    List<Map<String,Object>> findlist(){
        return orderInfoService.findlist();
    }

    @RequestMapping("/frind10")
    public Map frind10(){
        List<Vo> vos = orderInfoService.frind10();
        return SugarUtil.getMapData(vos);
    }

    @RequestMapping("/frind11")
    public Map frind11(){
        List<Vo> vos = orderInfoService.frind11();
        return SugarUtil.getBarData(vos);
    }

    @RequestMapping("/frind12")
    public Map frind12(){
        List<Vo> vos = orderInfoService.frind12();
        return SugarUtil.getPieData(vos);
    }

    @RequestMapping("/frind13")
    public Map frind13(){
        List<Vo> vos = orderInfoService.frind13();
        return SugarUtil.getPieData(vos);
    }
}
